<template>
  <div class="agreement">
    <div class="top">
      <img class="logo" @click="goHome" style="cursor: pointer;" src="../../assets/logos.png" />
    </div>
    <div class="title">
      {{name}}
    </div>
    <div class="content" v-html="content.replace(/\n/g, '<br>')"></div> 
  </div>
</template>
<script setup>
import { ref, onMounted, reactive } from "vue";
import { useRoute, useRouter } from "vue-router";
import {agreementContent} from "@/api/api";
import { decrypt } from "@/utils/parseDate";
import { useStore } from "vuex";
const store = useStore();
const route = useRoute();
const router = useRouter();
const content = ref("");
const name = ref("");
// 获取8904-隐私政策 8905-用户协议
async function getAgreementContent() {
  try {
    const res = await agreementContent(route.query.type);
    if (res.status === 0) {
      name.value = route.query.name
      content.value = res.result;
    }
  } catch (e) {
    
  }
}
function goHome() {
  router.push({
    name: "school",
  });
}
onMounted(() => {
  getAgreementContent()
});
</script>
<style lang="less" scoped>
.agreement {
  width: 1200px;
  margin: 0 auto;
  .top {
    margin-top: 30px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    //height: 50px;
    //line-height: 50px;
    img {
      width: 200px;
    }
    .el-button {
      margin-right: 20px;
    }
  }
  .title{
    text-align: center;
    font-size: 32px;
    font-weight: bold;
  }
  .content{
    line-height: 40px;
    letter-spacing:1.5px;
    font-size: 18px;
    margin-top: 40px;
  }
}
</style>
